home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / boosters.arc / REMBLK.ASM < prev    next >
Encoding:
Assembly Source File  |  1980-01-01  |  1.8 KB  |  90 lines

  1. ;**********************************************************************
  2. ;
  3. ;       Procedure REMBLK (X1,Y1,X2,Y2 : Integer);
  4. ;                 offset  10,08,06,04  from BP
  5. ;
  6. ;       Blanks area of screen at X1,Y1 (upper left)
  7. ;                                X2,Y2 (lower right)
  8. ;**********************************************************************
  9. REMBLK  proc    near
  10.         push    bp
  11.     mov    bp,sp
  12.     push    ds
  13. ;
  14. ;
  15. ;*** Compute number of lines to move
  16. ;
  17.     mov    ax,[bp+08]    ; value of Y1 into AX
  18.     mov    dx,[bp+04]    ; value of Y2 into CX
  19.         sub     dx,ax           ; DX = Y2 - Y1
  20.     inc    dx        ; DX = Number of lines
  21.     push    dx
  22. ;
  23. ;
  24. ;*** Compute length of each move
  25. ;
  26.     mov    ax,[bp+10]    ;  X1
  27.     mov    cx,[bp+06]    ;  X2
  28.     sub    cx,ax        ;  CX = X2 - X1
  29.     inc    cx        ;  CX = num WORDS/line
  30.     push    cx
  31. ;
  32. ;*** Determine Video Address
  33. ;
  34.     mov    bx,449h
  35.     xor    ax,ax
  36.     mov    ds,ax
  37.     mov    al, [bx]
  38.     cmp    al,7
  39.     jne    graphx
  40.     mov    dx,0B000h
  41.     jmp    m001
  42. graphx:
  43.     mov    dx,03DAh    ; for IBM CGA,
  44. VR:    in    al,dx        ; we must do this
  45.     and    al,1000b    ; so we won't see
  46.     jz    vr        ; snow . . . and
  47.     mov    dx,0B800h    ; so long, speed
  48. m001:    mov    es,dx
  49. ;
  50. ;*** Compute upper left offset of block
  51. ;
  52.     mov    di,[bp+08]    ;  Y1 into BX
  53.         dec     di              ;  (Y1-1)
  54.     mov    dx,di        ;  Save in DX
  55.     mov    cl,7
  56.     shl    dx,cl        ;  (Y1-1) * 128
  57.     mov    cl,5
  58.     shl    di,cl        ;  (Y1-1) *  32
  59.     add    di,dx        ;  (Y1-1) * 160
  60.     mov    ax,[bp+10]    ;  X1 into AX
  61.     dec    ax        ;  (X1-1)
  62.     shl    ax,1        ;  2 * (X1-1)
  63.     add    di,ax        ;  offset
  64. ;
  65.     pop    cx        ; Num words/line
  66.     pop    dx        ; Num lines to blank
  67. ;
  68. ;*** Blank area on screen
  69. ;
  70.     mov    ax,0E20h
  71.     cld
  72. AGAIN:    push    cx
  73. rep    stosw
  74. ;
  75.     pop    cx
  76.     dec    dx
  77.     jz    DONE2
  78.     add    di,160
  79.     sub    di,cx
  80.     sub    di,cx
  81.     jmp    AGAIN
  82. ;
  83. DONE2:    mov    sp,bp
  84.     sub    sp,2
  85.         pop     ds
  86.         mov     sp,bp
  87.         pop     bp
  88.     ret    8
  89. REMBLK  endp
  90.